<!DOCTYPE HTML>
<html>
<head>
	<meta charset="utf-8">
	<meta name="renderer" content="webkit|ie-comp|ie-stand">
	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
	<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
	<meta http-equiv="Cache-Control" content="no-siteapp" />
	<!--[if lt IE 9]>
	<script type="text/javascript" src="lib/html5.js"></script>
	<script type="text/javascript" src="lib/respond.min.js"></script>
	<script type="text/javascript" src="lib/PIE_IE678.js"></script>
	<![endif]-->
	<link href="__PUBLIC__/css/H-ui.min.css" rel="stylesheet" type="text/css" />
	<link href="__PUBLIC__/css/H-ui.admin.css" rel="stylesheet" type="text/css" />
	<link href="__PUBLIC__/css/style.css" rel="stylesheet" type="text/css" />
	<link href="__PUBLIC__/lib/icheck/icheck.css" rel="stylesheet" type="text/css" />
	<link href="__PUBLIC__/lib/Hui-iconfont/1.0.6/iconfont.css" rel="stylesheet" type="text/css" />
	<link href="Tpl/Service/common/order/orderCreate.css" rel="stylesheet" type="text/css" />
	<!--[if IE 6]>
	<script type="text/javascript" src="http://lib.h-ui.net/DD_belatedPNG_0.0.8a-min.js" ></script>
	<script>DD_belatedPNG.fix('*');</script>
	<![endif]-->
	<title>客服中心</title>
</head>
<body>
	<div class="container">
		<div class="buttonGroup row pt-20" id="buttonGroup">
			<volist name="type" id='vo' key='k'>
				<if condition="$k eq 1">
					<button class="btn btn-primary radius" type="{$vo[0]}">{$vo[1]}</button>
				<else />
					<button class="btn radius" type="{$vo[0]}">{$vo[1]}</button>
				</if>
				
			</volist>
		</div>
		<div class="row">
			<div class="col-6 mt-20 mb-20 lineVer">
				<form action="" method="post" class="form form-horizontal" id="form-customer-add" autocomplete="off">
					<input type="hidden" value="室内维修" name="DATA_9" id="Bcate">
					<input type="hidden" value="{$customer.id}" name="customer_id"></input>
					<div class="row cl">
						<label class="form-label col-3">工单细类：</label>
						<div class="formControls col-8">
							<span class="select-box input_h">
						      <select class="select" size="1" name="DATA_10" id="Scate">
						      </select>
						    </span>
						</div>
						<div class="col-1"> </div>
					</div>
					<div class="row cl">
						<label class="form-label col-3">联系电话：</label>
						<div class="formControls col-8">
							<input type="text" class="input-text input_h" value="{$customer.tel}" placeholder="请输入电话号码" id="no" name="DATA_11" datatype="*" errormsg="">
						</div>
						<div class="col-1"> </div>
					</div>
					<div class="row cl">
						<label class="form-label col-3">姓名：</label>
						<div class="formControls col-8">
							<input type="text" class="input-text input_h" value="{$customer.name}" placeholder="" id="name" name="DATA_6" datatype="*" errormsg="" nullmsg="请输入姓名">
						</div>
						<div class="col-1"> </div>
					</div>
					<div class="row cl">
						<label class="form-label col-3">家庭住址：</label>
						<div class="formControls col-8">
							<span class="select-box select-height">
						      <select class="select" size="1" name="DATA_8">
						      		<foreach name="customer.families" item="vo">
						      			<option value="{$vo.address}">{$vo.address}</option>
						      		</foreach>
						      </select>
						    </span>
						</div>
						<div class="col-1"> </div>
					</div>
					<div class="row cl">
						<label class="form-label col-3">事件说明：</label>
						<div class="formControls col-8">
							<textarea name="DATA_12" cols="" rows="" class="textarea"  placeholder="这里输入工单说明" dragonfly="true" value="" onKeyUp="textarealength(this,300)"></textarea>
							<p class="textarea-numberbar"><em class="textarea-length">0</em>/300</p>
						</div>
						<div class="col-1"> </div>
					</div>
					<div class="row cl">
						<label class="form-label col-3">紧急状态：</label>
						<div class="formControls col-8 skin-minimal">
								<div class="radio-box display">
									<input type="radio" id="work_level-1" name="work_level" class="work_level"  value="0" checked="checked">
									<label for="work_level-1">普通</label>
								</div>
								<div class="radio-box display">
									<input type="radio" id="work_level-2" name="work_level" class="work_level" value="2" datatype="*" nullmsg="请选择性别！">
									<label for="work_level-2">紧急</label>
								</div>	
						</div>
						<div class="col-1"> </div>
					</div>
					<div class="row cl">
						<label class="form-label col-3">立即指派：</label>
						<div class="formControls col-8">
							<span class="select-box input_h">
						      <select class="select" size="1" name="TO_DEPT" id="">
						      <!--<select class="select" size="1" name="DATA_13" id="">-->
						      <option value="" disabled="disabled">选择小区</option>
						      <foreach name="communities" item="v" key="k">
						     	 <option value="{$k}">{$v}</option>
							  </foreach>
						      </select>
						    </span>
						</div>
						<div class="col-1"> </div>
					</div>
					<div class="row cl">
						<div class="col-9 col-offset-3 margin_b">
							<!-- <input class="btn btn-primary radius" type="submit" value="提交"> -->
							<span  class="btn btn-primary radius input_h" id="formSub">提交</span>
						</div>
					</div>
				</form>
			</div>
			<div class="col-6 mt-20 massage_w">
				<p class="pl-20">流转记录:</p>
				<div class="wordRecord">
					<p class="">暂无流转记录</p>
				</div>
				
			</div>
		</div>
	</div>
	<script type="text/javascript" src="__PUBLIC__/lib/jquery/1.9.1/jquery.min.js"></script>
	<script type="text/javascript" src="__PUBLIC__/lib/icheck/jquery.icheck.min.js"></script> 
	<script type="text/javascript" src="__PUBLIC__/lib/Validform/5.3.2/Validform.min.js"></script>
	<script type="text/javascript" src="__PUBLIC__/lib/layer/2.1/layer.js"></script>
	<script type="text/javascript" src="__PUBLIC__/lib/laypage/1.2/laypage.js"></script>
	<script type="text/javascript" src="__PUBLIC__/js/H-ui.js"></script>
	<script type="text/javascript" src="__PUBLIC__/js/H-ui.admin.js"></script>
	<script type="text/javascript" src="__PUBLIC__/js/getUrl.js"></script>
	<script type="text/javascript" src="__PUBLIC__/lib/datatables/1.10.0/jquery.dataTables.min.js"></script>
<!--	<script type="text/javascript" src="Tpl/Service/common/order/create.js"></script>-->
	<script src="http://cdn.bootcss.com/jquery.form/3.51/jquery.form.min.js"></script>
	<script type="text/javascript">
		$('.skin-minimal input').iCheck({
		checkboxClass: 'icheckbox-blue',
		radioClass: 'iradio-blue',
		increaseArea: '20%'
		});
	// 全局
		var info={
			id:0,//业主id
			index:0,//下拉索引
			control:'Room',//控制器
			action:'autoComplete',//自动完成方法
			formName:'#searchName'//表名
		};
	$(function(){
		work.init();
		
	});
    
    var work={
	/*·····························初始化························*/
	init:function(){
		this.eventListen();
		this.getDict();
	},
	/*·····························事件监听························*/
	eventListen:function(){
		// 按钮颜色切换和取值放入隐藏域
		$(document).on("click","#buttonGroup button",function(){
			$("#Bcate").attr("value",$(this).text());
			$("#buttonGroup button").removeClass("btn-primary");
			$(this).addClass("btn-primary");
			var signId="#Scate";
			var type=$(this).attr("type");
			work.getDict(signId,type);
		});
		//表单提交
		$(document).on("click","#formSub",function(){
			work.formsub();
		});
	},
	/*·····························功能性函数························*/
	// iframe页面弹窗
	layerOpen:function(title,url){
		layer.open({
			type: 2,
			area: ['800px', '620px'],
			fix: false, //不固定
			maxmin: true,
			shade:0.4,
			title: title,
			content:url
		});
	},
	getDict:function(signId,type){
		var signId=(signId)?signId:"#Scate";
		var type=(type)?type:"maintain1";
		$.post("/index.php?m=Admin&c=Dict&a=getdict",{type:type},function(data){
				if(data){
					var str="";
					for(x in data){
						str+='<option value="'+data[x]['text']+'">'+data[x]['text']+'</option>';
					}
					$(signId).empty();
					$(signId).append(str);
				}else{
					$(signId).empty();
				}
		});
	},
	/*·····························插件初始化························*/
	formsub:function(){
	        $("#form-customer-add").ajaxSubmit({
	        type:'POST',
	        url:'/index.php?m=Service&c=Order&a=send',
	        success:function(data){
	          	// alert();
	        	if(data.stat==1){
	              layer.msg("添加成功");
	              var index = parent.layer.getFrameIndex(window.name);
	              setTimeout(function(){
	                   parent.layer.close(index);
	              },1000);
	              parent.location.reload();
	            	window.location.href="/index.php?m=Service&c=Center&a=index&tel="+info.tel;
	          }else{
	            layer.msg(data.msg);
	          }
	          }
	        });
	}
}
        
	</script>
	</body>
	</html>